<!doctype html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="css/mstyle.css" />
	</head>
	<body class="optionalPage">
		<!--navBar-->
		<header class="mui-bar mui-bar-nav">
			<a class="mui-icon mui-action-back mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title">自选</h1>
		</header>
		<!--contTitle-->
		<div class="contTitle mui-content">
			<div class="mui-row">
				<div class="mui-col-sm-6 mui-col-xs-6 nameDeal">
					<li class="mui-table-view-cell">名称</li>
				</div>
				<div class="mui-col-sm-3 mui-col-xs-3 topDeal">
					<li class="mui-table-view-cell price">置顶</li>
				</div>
				<div class="mui-col-sm-3 mui-col-xs-3 delDeal">
					<li class="mui-table-view-cell percent">删除</li>
				</div>
			</div>
		</div>
		<!--contInner-->
		<div class="contInner mui-scroll-wrapper" style="top:2.4rem;bottom:50px">
			<div class="mui-scroll mui-content dealList" id="cont"></div>
			<script type="text/template" id="temp">
				{%for(var i=0;i< data.length;i++){%}
				<div class="mui-row">
					<div class="mui-col-sm-6 mui-col-xs-6">
						<li class="mui-table-view-cell mui-double mui-clearfix">
							<img src="images/US_40_29.png" alt="" class="nameIcon" />
							<p class="nameInfo">
								<span class="name">{%=data[i].name%}</span><span>{%=data[i].code%}</span>
							</p>
						</li>
					</div>
					<div class="topOpt mui-col-sm-3 mui-col-xs-3 mui-single mui-clearfix"  data-code='{%=data[i].code%}'>
						<img src="images/ZhiDing_icon_30x20_@3x.png"/>
					</div>
					<div class="delOpt mui-col-sm-3 mui-col-xs-3 mui-single mui-clearfix"  data-code='{%=data[i].code%}'>
						<img src="images/JH_icon.png"/>
					</div>
				</div>
				{%}%}
			</script>
		</div>
	</body>
	<script src="js/mui.min.js"></script>
	<script src='libs/easymob-webim-sdk/jquery-1.11.1.js'></script>
	<script src='js/config.js'></script>
	<script src='js/temp.js'></script>
	<script src='js/mstock.js'></script>
	<script type="text/javascript">
		var codeListArr=[];
		mui.init();
		var old_back = mui.back;
		mui.back = function(){
			var stringS = '';
			for(var i=0;i< codeListArr.length;i++){
				if(i==codeListArr.length-1){
					stringS = stringS+codeListArr[i]
				}else{
					stringS = stringS+codeListArr[i]+','
				}	
			}
			var data = {
				action:"topChoice",
				app:'app',
				account:account,
				stockCodes:stringS
			}
			ajaxEve(server.optSel,data,function(result){
				mui.plusReady(function() {
			        var list = plus.webview.getWebviewById('optional.html');
					mui.fire(list,'refresh');
				})
				old_back();
				return true;
			})
		}
		mui('.mui-bar-nav').on('tap','.optionalEdit',function(){
			mui.openWindow({
				url: 'optionalEdit.html'
			});
		})
		mui('.mui-scroll-wrapper').scroll({
			scrollY: true, //是否竖向滚动
			scrollX: false, //是否横向滚动
			startX: 0, //初始化时滚动至x
			startY: 0, //初始化时滚动至y
			indicators: false, //是否显示滚动条
			deceleration: 0.0005, //阻尼系数,系数越小滑动越灵敏
			bounce: true //是否启用回弹
		});
		if(account&&account!=''){
			mstcok().optionalEdit();
		}
	</script>
</html>